﻿using System;
using System.Net;
using System.Linq.Expressions;
using System.Collections.Generic;

namespace SL8.SL.Data.Sql
{
    public interface IDAL
    {
        void Add<T>(T t, Action<Result<T>> onComplete) where T : new();

        void Delete<T>(Expression<Func<T, bool>> expr, Action<Result<T>> onComplete) where T : new();

        void Update<T>(T t, Expression<Func<T, object>> updater, Expression<Func<T, bool>> condition, Action<Result<T>> onComplete) where T : new();

        void Select<T>(SearchCondition<T> searchCondition, Action<Result<T>> onComplete) where T : new();

        void Select<T>(SearchCondition<T> searchCondition, Expression<Func<T, object>> selector, Action<Result<T>> onComplete) where T : new();

        void Excute<T>(string sql, Action<Result<T>> onComplete) where T : new();

        void GetRecordCount<T>(System.Linq.Expressions.Expression<Func<T, bool>> expr, Action<Result<RecordCount>> onComplete) where T : new();
    }
}
